package com.business.corp;

import com.basic.BankLoadEntity;
import com.basic.QxEntry;
import com.frame.struts.BaseBean;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.frame.struts.ActionContext;
import com.utils.CommUtil;
import com.utils.ConnectionManager;
import com.utils.NumberUtil;

import java.io.*;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.Date;

/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2006</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 */
public class NewCorpForm
	extends BaseBean {
	public NewCorpForm() {
	}

	private String oldId = "";
	//GsjlEntity gsjl = new GsjlEntity();
	public String addGds() {
		HttpServletRequest request = ActionContext.getActionContext().
			getRequest();
		HttpServletResponse response = ActionContext.getActionContext().
			getResponse();
		String qyid=(String)request.getSession().getAttribute("session_qyid");
		NewCorpFactory factory = NewCorpFactory.getInstance();
		factory.delGds(qyid);
		factory.addGds(request);
		try {
			response.sendRedirect("/corp/addgds.jsp");
		}
		catch (IOException ex) {
			ex.printStackTrace();
		}
		return null;
	}
	public String addGsjl() {
		HttpServletRequest request = ActionContext.getActionContext().
			getRequest();
		HttpServletResponse response = ActionContext.getActionContext().
			getResponse();
		String qyid=(String)request.getSession().getAttribute("session_qyid");
		NewCorpFactory factory = NewCorpFactory.getInstance();

		factory.delGsjl(qyid);
		factory.addGsjl(request);
		try {
			response.sendRedirect("/corp/addgs.jsp");
		}
		catch (IOException ex) {
			ex.printStackTrace();
		}
		return null;
/*		try{
			if (factory.addGsjl(gsjl)) {
				    response.sendRedirect("/corp/addgs.jsp");
			}
			else
			{
			     response.sendRedirect("/basic/failed.jsp");
			}
		}
		catch (Exception e) {

		}
		return null;*/
	}
	public String addZjjl() {
		HttpServletRequest request = ActionContext.getActionContext().
			getRequest();
		HttpServletResponse response = ActionContext.getActionContext().
			getResponse();
		String qyid=(String)request.getSession().getAttribute("session_qyid");
		NewCorpFactory factory = NewCorpFactory.getInstance();
		factory.delZjjl(qyid);
		factory.addZjjl(request);
		try {
			response.sendRedirect("/corp/addhuanbao.jsp");
		}
		catch (IOException ex) {
			ex.printStackTrace();
		}
		return null;
	}
	public String addHuanbao() {
		HttpServletRequest request = ActionContext.getActionContext().
			getRequest();
		HttpServletResponse response = ActionContext.getActionContext().
			getResponse();
		String qyid=(String)request.getSession().getAttribute("session_qyid");
		NewCorpFactory factory = NewCorpFactory.getInstance();
		factory.delHuanbao(qyid);
		factory.addHuanbao(request);
		try {
			response.sendRedirect("/corp/addhuanbao.jsp");
		}
		catch (IOException ex) {
			ex.printStackTrace();
		}
		return null;
	}
	public String addLaobao() {
		HttpServletRequest request = ActionContext.getActionContext().
			getRequest();
		HttpServletResponse response = ActionContext.getActionContext().
			getResponse();
		String qyid=(String)request.getSession().getAttribute("session_qyid");
		NewCorpFactory factory = NewCorpFactory.getInstance();
		factory.delLaobao(qyid);
		factory.addLaobao(request);
		try {
			response.sendRedirect("/corp/addlaobao.jsp");
		}
		catch (IOException ex) {
			ex.printStackTrace();
		}
		return null;
	}

	



}
